﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DGM.Objects.OAuth;
using DGM.Util.Helpers.OAuth_dotnet;

namespace DGM.Util.Dialog.OAuth
{
  public class OAuthorizeWindow : IOAuthGetAccessTokenCallback
  {
    public OAuthTokenAndVerifier Authorize(IOAuth oAuth)
    {
      OAuthTokenAndVerifier result = new OAuthTokenAndVerifier();
      var dialog = new OAuthorizeWindowDialog(oAuth);
      dialog.ShowDialog();

      result.Token = dialog.Token;
      result.Verifier = dialog.Verifier;

      return result;
    }
  }
}
